eststo main: nbreg kialow ib3.con_sys2 ww modern joiner democracy mean_log  mic_mean composite pop_mil dep_pop relpowermean ethnic , cluster(campcode) 


**make the predicted deaths figure 
margins, at(con_sys2=(1 2 3)) atmeans
marginsplot, xtitle("Labor Type") ytitle("Predicted Number of Battlefield Deaths")  ///
title("") recast(scatter) xscale(r(0 5)) xlabel(, labsize(small))



eststo withdur: nbreg kialow ib3.con_sys2 ww modern joiner democracy  mean_log  mic_mean composite pop_mil dep_pop relpowermean ethnic  lndur, cluster(campcode) 


margins, at(con_sys2=(1 2 3)) atmeans
marginsplot, xtitle("Labor Type") ytitle("Predicted Number of Battlefield Deaths")  ///
title("") recast(scatter) xscale(r(0 5)) xlabel(, labsize(small))


***only wars after 1945

eststo modern:  nbreg kialow ib3.con_sys2 ww modern joiner democracy mean_log  mic_mean composite pop_mil dep_pop relpowermean ethnic if year>1945, cluster(campcode)

**multiparty wars 
eststo multi:  nbreg kialow ib3.con_sys2 ww modern  democracy  mean_log  mic_mean composite pop_mil dep_pop relpowermean ethnic     if multiparty==0 , cluster(campcode)

 
**initiator
eststo init1:  nbreg kialow ib3.con_sys2 ww modern  democracy mean_log  mic_mean composite pop_mil dep_pop  rel ethnic if 	init==1  , cluster(campcode)
margins, at(con_sys2=(1 2 3)) atmeans


**no initiator
 
eststo init2:  nbreg kialow ib3.con_sys2  ww modern joiner democracy mean_log  mic_mean  composite pop_mil dep_pop relpowermean  ethnic if 	init==0  , cluster(campcode)
 
 margins, at(con_sys2=(1 2 3)) atmeans

 
margins, at(con_sys2=(1 2 3) atmeans
marginsplot, xtitle("Labor Type") ytitle("Predicted Number of Battlefield Deaths")  ///
title("") recast(scatter) xscale(r(0 6)) xlabel(, labsize(small))


***no deployed data
eststo no_proppop: nbreg kialow ib3.con_sys2 ww modern joiner democracy mean_log  mic_mean composite pop_mil  relpowermean ethnic , cluster(campcode) 

 

 
***make the table 
				  
				  

esttab main withdur modern multi no_proppop init1 init2 using table1045ddDFS.tex, replace label se nonotes varwidth(35) nobaselevels starlevels(* 0.10 ** 0.05 *** 0.01) ///
ti("Regressions on Battlefield Deaths") mlabels("" "")  ///
cells(b(star fmt(3)) se(par fmt(3)))  ///
stats(N ll, labels("Observations" "Log Likelihood") fmt(%9.0g)) addnotes("* p$\leq$0.10 ** p$\leq$.05 **** p$\leq$.01 in a two-tailed test.") 	





***make the 5 category count model table 

eststo main_5cat: nbreg kialow ib3.con_sys ww modern joiner democracy  mean_log  mic_mean composite pop_mil dep_pop  , cluster(campcode) 



esttab a5catdur post1945_5cat nomulti_5cat init1_5cat init2_5cat using table1045DfffdddFS.tex, replace label se nonotes varwidth(35) nobaselevels starlevels(* 0.10 ** 0.05 *** 0.01) ///
ti("Regressions on Battlefield Deaths") mlabels("" "")  ///
cells(b(star fmt(3)) se(par fmt(3)))  ///
stats(N ll, labels("Observations" "Log Likelihood") fmt(%9.0g)) addnotes("* p$\leq$0.10 ** p$\leq$.05 **** p$\leq$.01 in a two-tailed test.") 










********Cox Models 


*main model 

stset dur


eststo dur1: stcox ib3.con_sys2  ww democracy  mean_log init joiner  mic_mean  modern composite dep_pop pop_mil deathrat relpowermean ethnic,  cluster(campcode) nohr



esttab dur1  using table1077.tex, replace label se nonotes varwidth(35) nobaselevels starlevels(* 0.10 ** 0.05 *** 0.01) ///
ti("Cox Model on War Duration") mlabels("" "")  ///
cells(b(star fmt(3)) se(par fmt(3)))  ///
stats(N ll, labels("Observations" "Log Liklihood") fmt(%9.0g)) addnotes("* p<0.10 ** p<.05 **** p<.01 in a two-tailed test.") 



**make survival curves figures 

stcurve, survival at1(con_sys2=1) at2(con_sys2=2) at3(con_sys2=3) range(0 1500) ///
xtitle("Days") ytitle("Probability of War Continuing")  ///
title("")


***5 category duration model 
		
		

eststo durfive:  stcox ib3.con_sys  ww democracy  mean_log init joiner  mic_mean  modern composite dep_pop pop1000 deathrat relpowermean,  cluster(campcode) nohr
